﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Locations.aspx.cs" Inherits="Timesheet.WebForm.Cates.Locations" %>

<%@ Register Assembly="DevExpress.Web.v14.2, Version=14.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <div class="title">
        <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Locations" Font-Size="22px" Font-Bold="true" ForeColor="#4A72A3">
        </dx:ASPxLabel>
    </div>
    <dx:ASPxButton runat="server" ID="btnNewLocation" Font-Bold="True" Font-Overline="False" Text="New" OnClick="btnNewLocation_Click" CssClass="btnCateNewLocation"></dx:ASPxButton>    
    <dx:ASPxGridView
        KeyFieldName="Id"
        ID="grvLocations"
        runat="server"
        EnableTheming="True"
        Theme="Office2010Silver"       
        SettingsPager-PageSize="15"
        Width="500px"
        DataSourceID="dsLocations" AutoGenerateColumns="False" Settings-ShowPreview="True">
        <Columns>
            <dx:GridViewDataTextColumn FieldName="Id" VisibleIndex="0" UnboundType="Integer" Visible="false" ReadOnly="true">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="LocationName" VisibleIndex="1" Width="250px">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataCheckColumn FieldName="Active" VisibleIndex="2">
            </dx:GridViewDataCheckColumn>
            <dx:GridViewCommandColumn Caption="Action" ShowDeleteButton="true" VisibleIndex="3" Width="170px" MinWidth="100" ShowEditButton="true">
            </dx:GridViewCommandColumn>
        </Columns>
        <SettingsBehavior ConfirmDelete="true" ColumnResizeMode="Disabled" AllowFocusedRow="True" AllowSelectByRowClick="True" />

        <SettingsPager PageSize="20"></SettingsPager>

        <SettingsEditing Mode="Inline">
        </SettingsEditing>
       

        <SettingsCommandButton>
            <UpdateButton ButtonType="Button">
            </UpdateButton>
            <CancelButton ButtonType="Button">
            </CancelButton>
            <EditButton ButtonType="Button">
            </EditButton>
            <DeleteButton ButtonType="Button">
            </DeleteButton>
        </SettingsCommandButton>
        <Styles>
            <Header HorizontalAlign="Center" Font-Size="Small">
            </Header>
            <AlternatingRow BackColor="#EDF5FF" Enabled="True">
            </AlternatingRow>
            <SelectedRow BackColor="#99CCFF">
            </SelectedRow>
            <FocusedRow BackColor="#99CCFF">
            </FocusedRow>
            <Row Font-Size="11pt" Font-Names="Calibri">
            </Row>
        </Styles>
    </dx:ASPxGridView>

    <asp:ObjectDataSource ID="dsLocations" runat="server"
        DataObjectTypeName="Timesheet.Domain.Locations"
        DeleteMethod="Delete"
        InsertMethod="Add"
        SelectMethod="GetLocations"
        TypeName="Timesheet.Service.ILocationsService"
        UpdateMethod="Update"
        OnObjectCreating="ds_ObjectCreating"></asp:ObjectDataSource>


</asp:Content>

